<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GNetworkService: GIO Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="resolver.html" title="DNS resolution">
<link rel="prev" href="GNetworkAddress.html" title="GNetworkAddress">
<link rel="next" href="GSrvTarget.html" title="GSrvTarget">
<meta name="generator" content="GTK-Doc V1.26.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GNetworkService.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GNetworkService.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_interfaces">  <span class="dim">|</span> 
                  <a href="#GNetworkService.implemented-interfaces" class="shortcut">Implemented Interfaces</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GNetworkService.properties" class="shortcut">Properties</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="resolver.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GNetworkAddress.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GSrvTarget.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GNetworkService"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GNetworkService.top_of_page"></a>GNetworkService</span></h2>
<p>GNetworkService — A GSocketConnectable for resolving SRV records</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GNetworkService.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> *
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-new" title="g_network_service_new ()">g_network_service_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-get-service" title="g_network_service_get_service ()">g_network_service_get_service</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-get-protocol" title="g_network_service_get_protocol ()">g_network_service_get_protocol</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-get-domain" title="g_network_service_get_domain ()">g_network_service_get_domain</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-get-scheme" title="g_network_service_get_scheme ()">g_network_service_get_scheme</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GNetworkService.html#g-network-service-set-scheme" title="g_network_service_set_scheme ()">g_network_service_set_scheme</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GNetworkService.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GNetworkService.html#GNetworkService--domain" title="The “domain” property">domain</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GNetworkService.html#GNetworkService--protocol" title="The “protocol” property">protocol</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GNetworkService.html#GNetworkService--scheme" title="The “scheme” property">scheme</a></td>
<td class="property_flags">Read / Write</td>
</tr>
<tr>
<td class="property_type">
<a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td>
<td class="property_name"><a class="link" href="GNetworkService.html#GNetworkService--service" title="The “service” property">service</a></td>
<td class="property_flags">Read / Write / Construct Only</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GNetworkService.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GNetworkService.html#GNetworkService-struct" title="GNetworkService">GNetworkService</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GNetworkService.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="../gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>
    <span class="lineart">╰──</span> GNetworkService
</pre>
</div>
<div class="refsect1">
<a name="GNetworkService.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GNetworkService implements
 <a class="link" href="GSocketConnectable.html" title="GSocketConnectable">GSocketConnectable</a>.</p>
</div>
<div class="refsect1">
<a name="GNetworkService.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gio/gio.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GNetworkService.description"></a><h2>Description</h2>
<p>Like <a class="link" href="GNetworkAddress.html" title="GNetworkAddress"><span class="type">GNetworkAddress</span></a> does with hostnames, <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>
provides an easy way to resolve a SRV record, and then attempt to
connect to one of the hosts that implements that service, handling
service priority/weighting, multiple IP addresses, and multiple
address families.</p>
<p>See <a class="link" href="GSrvTarget.html" title="GSrvTarget"><span class="type">GSrvTarget</span></a> for more information about SRV records, and see
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> for and example of using the connectable
interface.</p>
</div>
<div class="refsect1">
<a name="GNetworkService.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-network-service-new"></a><h3>g_network_service_new ()</h3>
<pre class="programlisting"><a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="returnvalue">GSocketConnectable</span></a> *
g_network_service_new (<em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *service</code></em>,
                       <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *protocol</code></em>,
                       <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre>
<p>Creates a new <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> representing the given <em class="parameter"><code>service</code></em>
,
<em class="parameter"><code>protocol</code></em>
, and <em class="parameter"><code>domain</code></em>
. This will initially be unresolved; use the
<a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> interface to resolve it.</p>
<div class="refsect3">
<a name="g-network-service-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>service</p></td>
<td class="parameter_description"><p>the service type to look up (eg, "ldap")</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>protocol</p></td>
<td class="parameter_description"><p>the networking protocol to use for <em class="parameter"><code>service</code></em>
(eg, "tcp")</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>domain</p></td>
<td class="parameter_description"><p>the DNS domain to look up the service in</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-network-service-new.returns"></a><h4>Returns</h4>
<p>a new <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a>. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GNetworkService]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-service"></a><h3>g_network_service_get_service ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
g_network_service_get_service (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>Gets <em class="parameter"><code>srv</code></em>
's service name (eg, "ldap").</p>
<div class="refsect3">
<a name="g-network-service-get-service.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>srv</p></td>
<td class="parameter_description"><p>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-network-service-get-service.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>srv</code></em>
's service name</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-protocol"></a><h3>g_network_service_get_protocol ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
g_network_service_get_protocol (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>Gets <em class="parameter"><code>srv</code></em>
's protocol name (eg, "tcp").</p>
<div class="refsect3">
<a name="g-network-service-get-protocol.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>srv</p></td>
<td class="parameter_description"><p>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-network-service-get-protocol.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>srv</code></em>
's protocol name</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-domain"></a><h3>g_network_service_get_domain ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
g_network_service_get_domain (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>Gets the domain that <em class="parameter"><code>srv</code></em>
 serves. This might be either UTF-8 or
ASCII-encoded, depending on what <em class="parameter"><code>srv</code></em>
 was created with.</p>
<div class="refsect3">
<a name="g-network-service-get-domain.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>srv</p></td>
<td class="parameter_description"><p>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-network-service-get-domain.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>srv</code></em>
's domain name</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-22.html#api-index-2.22">2.22</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-get-scheme"></a><h3>g_network_service_get_scheme ()</h3>
<pre class="programlisting">const <a href="../glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *
g_network_service_get_scheme (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>);</pre>
<p>Get's the URI scheme used to resolve proxies. By default, the service name
is used as scheme.</p>
<div class="refsect3">
<a name="g-network-service-get-scheme.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>srv</p></td>
<td class="parameter_description"><p>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-network-service-get-scheme.returns"></a><h4>Returns</h4>
<p> <em class="parameter"><code>srv</code></em>
's scheme name</p>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
<hr>
<div class="refsect2">
<a name="g-network-service-set-scheme"></a><h3>g_network_service_set_scheme ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
g_network_service_set_scheme (<em class="parameter"><code><a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a> *srv</code></em>,
                              <em class="parameter"><code>const <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *scheme</code></em>);</pre>
<p>Set's the URI scheme used to resolve proxies. By default, the service name
is used as scheme.</p>
<div class="refsect3">
<a name="g-network-service-set-scheme.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>srv</p></td>
<td class="parameter_description"><p>a <a class="link" href="GNetworkService.html" title="GNetworkService"><span class="type">GNetworkService</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>scheme</p></td>
<td class="parameter_description"><p>a URI scheme</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-2-26.html#api-index-2.26">2.26</a></p>
</div>
</div>
<div class="refsect1">
<a name="GNetworkService.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GNetworkService-struct"></a><h3>GNetworkService</h3>
<pre class="programlisting">typedef struct _GNetworkService GNetworkService;</pre>
<p>A <a class="link" href="GSocketConnectable.html" title="GSocketConnectable"><span class="type">GSocketConnectable</span></a> for resolving a SRV record and connecting to
that service.</p>
</div>
</div>
<div class="refsect1">
<a name="GNetworkService.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GNetworkService--domain"></a><h3>The <code class="literal">“domain”</code> property</h3>
<pre class="programlisting">  “domain”                   <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>Network domain, eg, "example.com".</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--protocol"></a><h3>The <code class="literal">“protocol”</code> property</h3>
<pre class="programlisting">  “protocol”                 <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>Network protocol, eg "tcp".</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--scheme"></a><h3>The <code class="literal">“scheme”</code> property</h3>
<pre class="programlisting">  “scheme”                   <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>Network scheme (default is to use service).</p>
<p>Flags: Read / Write</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="GNetworkService--service"></a><h3>The <code class="literal">“service”</code> property</h3>
<pre class="programlisting">  “service”                  <a href="../glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre>
<p>Service name, eg "ldap".</p>
<p>Flags: Read / Write / Construct Only</p>
<p>Default value: NULL</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.26.1</div>
</body>
</html>